<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>猜你喜欢</title>
    <style>
      .checkbox {
        display: inline-block;
        margin: 10px;
      }
    </style></style>
  </head>
  <body>
    <div id="app">
    <h1>请选择你喜欢的专栏：</h1>
      <div v-for="(item,index) in list" :key="index" class="checkbox">
        <input type="checkbox" v-model="item.isChecked" />
        {{item.name}}
      </div>
      <div class="ulList">
        <ul>
            <li v-for="(item,index) in list" :key="index" v-if="item.isChecked">
                {{item.name}}
            </li>
        </ul>
      </div>
    </div>
    <script src="../js/vue.js"></script>
    <script>
      const app = new Vue({
        el: "#app",
        data: {
          list: [
            { name: "科幻", isChecked: false },
            { name: "喜剧", isChecked: false },
            { name: "动漫", isChecked: false },
            { name: "冒险", isChecked: false },
            { name: "科技", isChecked: false },
            { name: "军事", isChecked: false },
            { name: "娱乐", isChecked: false },
            { name: "奇闻", isChecked: false },
          ],
        },
      });
    </script>
  </body>
</html>
